<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body,
        ul{
            margin: 0;
        }
        ul{
            list-style: none;
            padding: 0;
        }
        a{
            text-decoration: none;
        }
        .nav{
            width: 100%;
            height: 50px;
            background-color: skyblue;
            margin-top: 50px;
        }
        
        .nav ul{
            width: 1200px;
            /* border: 1px solid #000; */
            margin: 0 auto;
            
        }
        .nav ul li{
            float: left;
            /* border: 1px solid #000; */
            
        }
        .nav ul li a{
            padding: 0 20px;
            display: block;
            line-height: 50px;
            color: #000;
            position: relative;
            z-index: 0;
            /* 创建层叠上下文 */
        }
        .clearfix::after{
            content: "";
            display: block;
            clear: both;
        }

        .nav ul li a::before{
            content:"";
            display: none;
            position: absolute;
            background-color: rgb(4, 130, 179);
            top: -5px;
            left: 0;
            right: 0;
            bottom: -5px;
            z-index: -1;

        }
        .nav ul li a:hover{
            color: #fff;
        }
        .nav ul li a:hover:before{
            display: block;
        }
    </style>
</head>
<body>
    <div class="nav">
        <ul class="clearfix">
            <li><a href="#">首页</a></li>
            <li><a href="#">免费直播课</a></li>
            <li><a href="#">web前端工程师</a></li>
            <li><a href="#">Java架构师</a></li>
            <li><a href="#">实战案例视频</a></li>
            <li><a href="#">关于我们</a></li>
        </ul>
    </div>
</body>
</html>